package util.mycomponents
{
	
	import util.Event.ValueEvent;
	
	import flash.events.KeyboardEvent;
	import flash.ui.Keyboard;
	
	import mx.containers.Form;

	/**
	 * 点击查询或按下enter都会提交动作
	 */ 
	[Event(name="action", type="util.Event.ValueEvent")]
	public class MyActionForm extends Form
	{
		public function MyActionForm()
		{
			super();
		}
		override protected function initializeAccessibility():void{
			super.initializeAccessibility();
			this.addEventListener(KeyboardEvent.KEY_DOWN,action);
		}
		protected function action(e:KeyboardEvent):void{
			if(e.keyCode==Keyboard.ENTER){
				this.dispatchEvent(new ValueEvent("action",null,true));
			}
		}
		
	}
}